﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<%
    int lang = (int)ViewData["Language"];
    VietImage.Models.Category cat = (VietImage.Models.Category)ViewData["Category"];
    VietImage.Models.Category par = null;
    if (cat != null)
    {
        String actionName = "Detail";
        if (ViewData["Parent"] is VietImage.Models.Category)
        {
            par = (VietImage.Models.Category)ViewData["Parent"];
            if (par.ID == 254)
            {
                actionName = "ReportageDetail";
            }
        }
%>
<div class="categorylistitem" title="<%= cat.GetDetail(lang).Name%>" onclick="movetopage('<%=Url.Action(actionName, "Category", new { id = cat.ID }) %>');">
    <div class="categorylistitem_image">
        <img alt="<%= cat.GetDetail(lang).Name%>" class="reflect" src="/Image/Category/<%= cat.ID %>" />
    </div>
    <div class="categorylistitem_title">
    <% 
        if (cat.IsParent)
        {
            %>
            <%= cat.GetDetail(lang).Name%>
            <%
        }
        else
        {
            if (par != null && par.ID == 254)
            {
            %>
            <span>Chùm ảnh</span> <%= cat.GetDetail(lang).Name%>
            <%
            }
            else
            {
            %>
            <div><span>Chùm ảnh</span> <%= cat.GetDetail(lang).Name%></div>
            <div><%= cat.Author%></div>
            <%
            }
        }
        %>
    </div>
</div>

<%
    }
 %>
